* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: rgb(195, 172, 29);
    padding: 20px;
}

.calculator-container {
    width: 100%;
    max-width: 400px;
    background-color: #2c3e50;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.display {
    background-color: #1a252f;
    color: white;
    padding: 25px 20px;
    text-align: right;
    position: relative;
}

.calculation {
    font-size: 1.2rem;
    min-height: 28px;
    color: #aaa;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result {
    font-size: 2.5rem;
    font-weight: 300;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background-color: #34495e;
}

button {
    border: none;
    outline: none;
    background-color: #2c3e50;
    color: white;
    font-size: 1.3rem;
    padding: 20px 0;
    cursor: pointer;
    transition: all 0.2s;
}
a {
    background-color: #2c3e50;
    color: rgb(195, 172, 29);
    font-size: 1.3rem;
    padding: 20px 0;
}

    button:hover {
        background-color: #3a506b;
    }

    button:active {
        background-color: #1a252f;
        transform: scale(0.95);
    }

.operator {
    background-color: #34495e;
}

.equals {
    background-color: #e74c3c;
    grid-column: span 2;
}

    .equals:hover {
        background-color: #c0392b;
    }

.clear, .backspace {
    background-color: #3498db;
}

    .clear:hover, .backspace:hover {
        background-color: #2980b9;
    }

.memory {
    background-color: #9b59b6;
}

    .memory:hover {
        background-color: #8e44ad;
    }

.history-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 37, 47, 0.95);
    padding: 20px;
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

    .history-panel.show {
        transform: translateY(0);
    }

.history-title {
    color: white;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.history-list {
    list-style: none;
}

    .history-list li {
        color: #ddd;
        padding: 10px 0;
        border-bottom: 1px solid #34495e;
    }

.close-history {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.history-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.2rem;
    cursor: pointer;
}

.calculator-title {
    color: white;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.8rem;
}

.instructions {
    color: white;
    background-color: rgba(44, 62, 80, 0.8);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    max-width: 400px;
}

    .instructions h3 {
        margin-bottom: 10px;
    }

    .instructions ul {
        padding-left: 20px;
    }

    .instructions li {
        margin-bottom: 5px;
    }
